package 算法面试;

public class 反转字符串 {
    public void reverseString(char[] s) {
        int key1 = 0;
        int key2 = s.length - 1;

        char c;
        while (key2 > key1) {
            c = s[key1];
            s[key1] = s[key2];
            s[key2] = c;
            key1++;
            key2--;
        }
    }
}
